﻿///////////////////////////////////////////////////////////////
// This is generated code. 
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 3.1
// Code is generated on: 2012年10月10日 8:11:47
// Code is generated using templates: SD.TemplateBindings.SharedTemplates.NET20
// Templates vendor: Solutions Design.
// Templates version: 
//////////////////////////////////////////////////////////////
using System;
using System.Collections;
using System.Collections.Generic;
using NetDon.eBoss.Data;
using NetDon.eBoss.Data.FactoryClasses;
using NetDon.eBoss.Data.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NetDon.eBoss.Data.RelationClasses
{
	/// <summary>Implements the relations factory for the entity: Productgroup. </summary>
	public partial class ProductgroupRelations
	{
		/// <summary>CTor</summary>
		public ProductgroupRelations()
		{
		}

		/// <summary>Gets all relations of the ProductgroupEntity as a list of IEntityRelation objects.</summary>
		/// <returns>a list of IEntityRelation objects</returns>
		public virtual List<IEntityRelation> GetAllRelations()
		{
			List<IEntityRelation> toReturn = new List<IEntityRelation>();
			toReturn.Add(this.HtmltoolaccountEntityUsingAccountid);
			toReturn.Add(this.HtmltoolcategoryruleEntityUsingCategoryruleid);
			toReturn.Add(this.HtmltoolstyleEntityUsingStyleid);
			toReturn.Add(this.HtmltooltrademarksettingEntityUsingTrademarkid);
			toReturn.Add(this.TitlesettingEntityUsingColorid);
			return toReturn;
		}

		#region Class Property Declarations



		/// <summary>Returns a new IEntityRelation object, between ProductgroupEntity and HtmltoolaccountEntity over the m:1 relation they have, using the relation between the fields:
		/// Productgroup.Accountid - Htmltoolaccount.Id
		/// </summary>
		public virtual IEntityRelation HtmltoolaccountEntityUsingAccountid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Htmltoolaccount", false);
				relation.AddEntityFieldPair(HtmltoolaccountFields.Id, ProductgroupFields.Accountid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("HtmltoolaccountEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductgroupEntity", true);
				return relation;
			}
		}
		/// <summary>Returns a new IEntityRelation object, between ProductgroupEntity and HtmltoolcategoryruleEntity over the m:1 relation they have, using the relation between the fields:
		/// Productgroup.Categoryruleid - Htmltoolcategoryrule.Id
		/// </summary>
		public virtual IEntityRelation HtmltoolcategoryruleEntityUsingCategoryruleid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Htmltoolcategoryrule", false);
				relation.AddEntityFieldPair(HtmltoolcategoryruleFields.Id, ProductgroupFields.Categoryruleid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("HtmltoolcategoryruleEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductgroupEntity", true);
				return relation;
			}
		}
		/// <summary>Returns a new IEntityRelation object, between ProductgroupEntity and HtmltoolstyleEntity over the m:1 relation they have, using the relation between the fields:
		/// Productgroup.Styleid - Htmltoolstyle.Id
		/// </summary>
		public virtual IEntityRelation HtmltoolstyleEntityUsingStyleid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Htmltoolstyle", false);
				relation.AddEntityFieldPair(HtmltoolstyleFields.Id, ProductgroupFields.Styleid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("HtmltoolstyleEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductgroupEntity", true);
				return relation;
			}
		}
		/// <summary>Returns a new IEntityRelation object, between ProductgroupEntity and HtmltooltrademarksettingEntity over the m:1 relation they have, using the relation between the fields:
		/// Productgroup.Trademarkid - Htmltooltrademarksetting.Id
		/// </summary>
		public virtual IEntityRelation HtmltooltrademarksettingEntityUsingTrademarkid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Htmltooltrademarksetting", false);
				relation.AddEntityFieldPair(HtmltooltrademarksettingFields.Id, ProductgroupFields.Trademarkid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("HtmltooltrademarksettingEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductgroupEntity", true);
				return relation;
			}
		}
		/// <summary>Returns a new IEntityRelation object, between ProductgroupEntity and TitlesettingEntity over the m:1 relation they have, using the relation between the fields:
		/// Productgroup.Colorid - Titlesetting.Id
		/// </summary>
		public virtual IEntityRelation TitlesettingEntityUsingColorid
		{
			get
			{
				IEntityRelation relation = new EntityRelation(SD.LLBLGen.Pro.ORMSupportClasses.RelationType.ManyToOne, "Titlesetting", false);
				relation.AddEntityFieldPair(TitlesettingFields.Id, ProductgroupFields.Colorid);
				relation.InheritanceInfoPkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("TitlesettingEntity", false);
				relation.InheritanceInfoFkSideEntity = InheritanceInfoProviderSingleton.GetInstance().GetInheritanceInfo("ProductgroupEntity", true);
				return relation;
			}
		}
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSubTypeRelation(string subTypeEntityName) { return null; }
		/// <summary>stub, not used in this entity, only for TargetPerEntity entities.</summary>
		public virtual IEntityRelation GetSuperTypeRelation() { return null;}
		#endregion

		#region Included Code

		#endregion
	}
	
	/// <summary>Static class which is used for providing relationship instances which are re-used internally for syncing</summary>
	internal static class StaticProductgroupRelations
	{
		internal static readonly IEntityRelation HtmltoolaccountEntityUsingAccountidStatic = new ProductgroupRelations().HtmltoolaccountEntityUsingAccountid;
		internal static readonly IEntityRelation HtmltoolcategoryruleEntityUsingCategoryruleidStatic = new ProductgroupRelations().HtmltoolcategoryruleEntityUsingCategoryruleid;
		internal static readonly IEntityRelation HtmltoolstyleEntityUsingStyleidStatic = new ProductgroupRelations().HtmltoolstyleEntityUsingStyleid;
		internal static readonly IEntityRelation HtmltooltrademarksettingEntityUsingTrademarkidStatic = new ProductgroupRelations().HtmltooltrademarksettingEntityUsingTrademarkid;
		internal static readonly IEntityRelation TitlesettingEntityUsingColoridStatic = new ProductgroupRelations().TitlesettingEntityUsingColorid;

		/// <summary>CTor</summary>
		static StaticProductgroupRelations()
		{
		}
	}
}
